﻿<!doctype html>
 <html >
 <head>
   <meta charset="UTF-8">
   <link rel="stylesheet" href="../../../css/common.css">
   <link rel="stylesheet" href="../../../css/main.css">
   <script type="text/javascript" src="../../../js/jquery.min.js"></script>
   <script type="text/javascript" src="../../../js/colResizable-1.3.min.js"></script>
   <script type="text/javascript" src="../../../js/common.js"></script>
</head>

<body>
  <div id="forms" class="mt10">
        <div class="box">
          <div class="box_border">
            <div class="box_top"><b class="pl15">预定车辆</b></div>
            <div class="box_center">
              <form  id="form" class="jqtransform">
               <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                 <tr>
                  <td class="td_right">车牌号：</td>
                  <td class="">
                      <select class="input-text lh30" name="carId"  >
                          <option value="">请选择</option>
                          <#list list as list>
                             <option value="${list.carId}">${list.numCard}</option>
                          </#list>
                      </select>
                  </td>
				  </tr>
				  <tr>
                  <td class="td_right">用车人：</td>
				  <td><input type="text" readonly name="realName" value="${user.realName}"></td>
                </tr>
				
				<tr>
                  <td class="td_right">时间：</td>
				  <td>
                      <input type="date" name="startTime" class="input-text lh30" size="40">to
				      <input type="date" name="endTime" class="input-text lh30" size="40">
                  </td>
                </tr>
                 <tr>
                  <td class="td_right">目的地：</td>
				  <td><input type="text" name="bourn" class="input-text lh30" size="40"></td>
                </tr>
				<tr>
                  <td class="td_right">申请里程：</td>
				  <td><input type="text" name="mileage" class="input-text lh30" size="40"></td>
                </tr>
				<tr>
                  <td class="td_right">用车事由：</td>
				  <td><textarea name="applyCause"  class="input-text lh30" ></textarea>
                </tr>
				<tr>
                  <td class="td_right">下一步审批人：</td>
				  <td>
                      <select name="userId" class="input-text lh30">
                          <option value="">请选择</option>
                          <option value="2">行政主管</option>
                      </select></td>
                </tr>
                 <tr>
                   <td class="td_right">&nbsp;</td>
                   <td class="">
                     <input type="button" onclick="reserveCar()" class="btn btn82 btn_save2" value="确定">
                    <input type="button" name="button" class="btn btn82 btn_res" onclick="location.href='javascript:history.go(-1)'" value="返回"> 
                   </td>
                 </tr>
               </table>
               </form>
            </div>
          </div>
        </div>
     </div>
   </div> 
</body>

 <script type="text/javascript" src="${req.contextPath}/js/jquery.min.js"></script>
 <script>
     function reserveCar() {
            var formData = $("#form").serialize();
            $.post(
                "${req.contextPath}/administrative/reserveCar",
                formData,
                function (result) {
                    if (result.code==0){
                        alert("添加成功");
                        location.href = "${req.contextPath}/resource/xingzheng/demo2/list";
                    }
                    else {
                        if (result.code==199){
                            alert(result.msg)
                        }else {
                        alert("此车在本时间段已被预定");
                        }
                    }
                },
                "json"
            );

     }


 </script>

</html>